#include "stdio.h"
#include "stdlib.h"
#include "string.h"

int countDistinctWord(char s[]) {
    int in=0;int count=0;
	char *del=" ";
	char *p[20];
	char *q;
	char *buff = s;
	while((p[in]=strtok_s(buff,del,&q))!=NULL) {
			in++;
			buff=NULL; 
	}
	for(int i=0;p[i]!=NULL;i++)
		for(int j=i+1;p[j]!=NULL;j++){
		if(strcmp(p[i],p[j])==0) p[j]=" ";
		}
	for(int i=0;p[i]!=NULL;i++){
		if(strcmp(p[i]," ")!=0)count++;
		}

		return count;
}

int main(void) {
	char s[] = "a b c def asg da fe d c b";
	printf("%d", countDistinctWord(s));
	return 0;
}